package com.iona.domain;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;

@Entity
public class Discipline extends BaseEntity {

	private String name;

	@Column(length = 2000)
	private String description;
	@OneToMany
	@JoinColumn(name = "discipline_fk")
	private List<DisciplinePurview> purviewList;
	@OneToMany
	@JoinColumn(name = "parent_fk")
	private List<DisciplineTree> parentList;
	@OneToMany
	@JoinColumn(name = "child_fk")
	private List<DisciplineTree> childList;

	public List<DisciplinePurview> getPurviewList() {
		if (purviewList == null) {
			purviewList = createList();
		}
		return purviewList;
	}

	public void setPurviewList(List<DisciplinePurview> purviewList) {
		this.purviewList = purviewList;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public List<DisciplineTree> getParentList() {
		if (parentList == null) {
			parentList = createList();
		}
		return parentList;
	}

	public void setParentList(List<DisciplineTree> parentList) {
		this.parentList = parentList;
	}

	public List<DisciplineTree> getChildList() {
		if (childList == null) {
			childList = createList();
		}
		return childList;
	}

	public void setChildList(List<DisciplineTree> childList) {
		this.childList = childList;
	}

}
